package com.jlhlyby.util;

import com.jlhlyby.link.ListNode;
import com.jlhlyby.tree.TreeNode;

public class Print {
    public static void printNode(TreeNode node){
        if (node == null){
            return;
        }
        System.out.print(node.val);
        printNode(node.left);
        printNode(node.right);
        System.out.println();

    }
    public static void printLink(ListNode node){
        if (node == null){
            return;
        }
        while (node != null){
            System.out.print(node.val);
            node = node.next;
        }
        System.out.println();
    }
}
